<!--日期类查询-->
<template>
  <!--查询内容-->
  <div :style="{width: (150 * colCount - 10 ) + 'px'}" style="float:left;">
    <div style="float:left;" :style="{width: (150 * colCount - 40 ) + 'px'}">
      <component
        :is="formItemKey[controlType]"
        :model="model"
        v-bind="$attrs"
        colName="value"
      >
      </component>
    </div>
  </div>
</template>

<script>
import { defineComponent } from 'vue'

// 引入表单子控件
// import { formItem } from '../../form/item/_map-form-item'

/*
const {
  nfDate,
  nfDatetime,
  nfMonth,
  nfWeek,
  nfYear,
  nfTimePicker,
  nfTimeSelect
} = formItem
*/

/*
* 日期类
*/
export default defineComponent({
  name: 'el-find-item-text',
  inheritAttrs: false,
  props: {
    controlType: Number, // 控件类型
    model: Object, // 查询结果，数组形式
    colCount: { // 占用空间
      type: Number,
      default: 1
    },
    delay: { // 防抖
      type: Number,
      default: 0
    }
  },
  components: {
    // 'nf-date': nfDate,
    // 'nf-datetime': nfDatetime,
    // 'nf-month': nfMonth,
    // 'nf-week': nfWeek,
    // 'nf-year': nfYear,
    // 'nf-time-picker': nfTimePicker,
    // 'nf-time-select': nfTimeSelect
  },
  setup (props, context) {
    // 表单子控件 to 查询子控件 的 字典
    // console.log('查询文本框===props', props, context)

    const formItemKey = {
      110: 'nf-date',
      111: 'nf-datetime',
      112: 'nf-month',
      113: 'nf-week',
      114: 'nf-year',
      115: 'nf-time-picker',
      116: 'nf-time-select'
    }
    return {
      formItemKey
    }
  }
})
</script>
